import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('@/views/login.vue') },
  {
    path: '/',
    component: () => import('@/layout'),
    redirect: '/dashboard',
    children: [
      { path: '/dashboard', component: () => import('@/views/dashboard.vue') },
      { path: '/article', component: () => import('@/views/article.vue') },
      { path: '/publish', component: () => import('@/views/publish.vue') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
